﻿// ////////////////////////////////////////////////////////////////////////////
// 
// SWE Case Tool
// 
// Solution:	CaseTool
// Project:		5. CaseToolUnitTests
// Filename:	CocomoUnitTests.cs
// 
// File Created:	18:07 27.05.2013 
// Last Changed:	18:10 05.06.2013
// 
// ////////////////////////////////////////////////////////////////////////////

using System.IO;
using NUnit.Framework;
using SWE.CaseTool.Methods;

namespace CaseToolUnitTests
{
	/// <summary>
	/// Unit Tests for the comcomo method.
	/// </summary>
	[TestFixture]
	public class CocomoTests
	{
		/// <summary>
		/// Tests the right functionality of the cocomo method.
		/// Uses the default values (factors and size) and compares with self calculated value.
		/// </summary>
		[Test]
		public void T001_CocomoResultWithDefaultValues()
		{
			if (File.Exists(@"ExternalFiles\cocomodefault.xml"))
			{
				File.Delete(@"ExternalFiles\cocomodefault.xml");
			}

			var cocomo = new CocomoMethod {KDSI = 42};
			Assert.That(cocomo.Calculate(), Is.EqualTo(7.74994).Within(5e-5));
		}
	}
}